<!-- 地区选址 -->
<template>
	<view class="content">
		<t-city :city="city" @tapFun="tapFun" />
	</view>
</template>

<script>
	import TCity from '@/components/t-city.vue';
	export default {
		components: {
			't-city': TCity
		},
		data() {
			return {
				city: ''
			}
		},
		onLoad(e) {
			console.log(e)
			this.city = e.city
		},
		methods: {
			tapFun(index, e) {
				console.log("父组件监听")
				let cityName = e.cityName || e.city
				console.log(index)
				console.log(cityName)
				// getApp().globalData.cityName;
				let pages = getCurrentPages(); //获取页面栈
				let prevPage = pages[pages.length - 2];
				prevPage.setData({
					city: cityName
				})
				uni.navigateBack({
					delta: 2
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #fff;
	}
</style>
